{% extends "base.html" %}

{% if app_info %}
{% block head_title %}{{ app_info.app_name }} for {{ app_info.institution.display_form }}{% endblock %}
{% endif %}


{% block more-js %}
<script type="text/javascript" src="/js/jquery/jquery.highlight-3.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/sizing.js"></script>
<script type="text/javascript" src="/js/public.js"></script>
<script type="text/javascript" src="/js/menu.js"></script>
<!--<script language="JavaScript">//-->
{% endblock %}

{% block more-css %}

<!--<link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/treeview/jquery.treeview.css" type="text/css" />//-->
<link type="text/css" rel="stylesheet" href="/stylesheets/public.css" />
<link type="text/css" href="/stylesheets/jquery/ui.public.css" rel="stylesheet" />
{% endblock %}

{% block wrapper %}

<div id="wrapper">
{% block header %}
<!-- START BANNER //-->
<div id="banner">
        <div id="logo">
            <center><img src="/media/logo_back.JPG" /></center>
        </div>
        <div id="search">
           <h3>Search</h3>
            <div id="id-search-div">
        &nbsp;<input id="search_terms" type="text" size="45" />
                <input type="button" onclick="Search()" value="Go" /><br/>
                <input type="radio" name="sitesearch" value="all" />Global Search<br />
                <input type="radio" name="sitesearch" value="elibrary" checked />E-Library<br />
                <input type="radio" name="sitesearch" value="catalog" />Library Catalog
                </div>
        </div>
        <!-- START HELP TOPICS DIV //-->
        <div id="question">
                <h3>Help Topics</h3>
                <div id="id-help-div"><p>
                        How do I <select id="id-howdoi-select" name="howdoi-select">
                        {% for item in howdois %}
                                <option value="{{ item.key }}"  style="width: auto">{{ item.question }}?</option>
                        {% endfor %}</select>
                        <button onclick="GetHelpTopic()">Answer</button></p>
                </div>
        </div>
        <!-- END HELP TOPICS DIV //-->
</div>
<!-- END BANNER DIV //-->
{% endblock %}

{% block contents %}
<!-- START DYNAMIC CONTENT DIV //-->
<div id="main">
        <h3>{% if app_info %}About {{ app_info.app_name }} {% else %}[APPLICATION INFO NOT KNOWN] <a href="/manage">SET-UP</a>{% endif %}</a></h3>
        <div id="main-display-div">
                <p class="res-detail">
                {% if app_info %}
                <b>Description:</b><br/>{{ app_info.institution.display_form }} E-Library provides access to purchased electronic resources
                and vetted web-sites for your research needs. {{ app_info.app_name }} currently has {{ resource_info.total_purchased }} purchased
                resources and {{ resource_info.total_free }} research web-sites.</p>
                {% else %}
                [APPLICATION SETUP NOT COMPLETE, PLEASE GO TO <a href="/manage">SET-UP</a> interface]
                {% endif %}
                </p>
        </div>
</div>
<!-- END DYNAMIC CONTENT DIV //-->

<!-- START TREEVIEW ACORDIAN DIVs //-->
<div id="left-wrapper">
        <h3 id="pop">Popular Resources</h3>
        <div class="left-nav" id="pop-tree">
                <ul>
                {% for resource in popular_resources %}
                {{ resource|endeavor_subtree:app_view }}
                {% endfor %}
                </ul>
        </div>
        <h3 id="subjects">Browse Subjects</h3>
        <div class="left-nav" id="subjects-tree">
               <!-- {% for subject in concepts %}
                <ul>
                        <li class="closed"><span class="folder">{{ subject.display_form }} ({{ subject.resources|length }})
                         <sup><a href="#" onclick="DisplayCollection('{{ subject.display_form }}')">more</a></sup></span>
                                <ul>
                                  <li>Loading...</li>
                                </ul>
                </ul>
                {% endfor %} //-->
        </div>
        <!-- START BROWSE TITLES ACCORDION //-->
        <h3 id="titles">Browse Titles</h3>
        <div class="left-nav" id="titles-tree">
                <!-- <ul>
                {% for resource_alpha in resource_titles %}
                  <li class="closed"><span class="folder">{{ resource_alpha.0|upper }} ({{ resource_alpha.1|length }})
                  <sup><a href="#" onclick="DisplayCollection('{{ resource_alpha.0 }}')">more</a></sup></span>
                  <ul id="{{ resource_alpha.0}}_ul">
			       <li>Loading...</li>
			      </ul>
                {% endfor %}
                </ul> //-->
   <!-- END TITLES ACCORDION //-->
        </div>
        <h3 id="trials">Browse Trials</h3>
        <div class="left-nav" id="trials-tree" style="border-bottom:none">No current trials for {{ app_info.institution.display_form }}. </div>
   <!-- BEGIN GOLD RUSH LINK //-->
   <div id="gold">
        <h3>Gold Rush</h3>
        <a href="http://goldrush.coalliance.org/index.cfm?inst_code=001_WSC" target="_top"><img src="http://grweb.coalliance.org/images/stories/imgs/GR-golddot-logo.gif" width="120px" border="0" alt="Gold Rush Journal Finder" />Journal Finder</a>
        &nbsp;Search for a <b>journal</b> or <b>magazine</b>
        </div>
   <!-- END GOLD RUSH LINK //-->
</div>

{% endblock %}
</div>
<!-- END TREEVIEW ACORDIAN DIVs //-->



{% block body-js %}
<script>
        $(document).ready(function() {
        //alert('Document Width: ' + $(document).width());

            //$('div.accordian> div').hide();
            //$('#pop-tree').show();
            /*$('div.accordian> h3').click(function() {
                    $(this).next('div').slideToggle('fast')
                    .siblings('div:visible').slideUp('fast');
            });*/
            initSizing();

            initMenu();
        });
	LoadTrees();
</script>
{% endblock %}{% endblock %}

